package cn.yunhe.video.Service.impl;

import cn.yunhe.video.Service.ICoinService;
import cn.yunhe.video.dao.CoinMapper;
import cn.yunhe.video.entity.Coin;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class CoinServiceImpl extends ServiceImpl<CoinMapper, Coin> implements ICoinService {
    @Autowired
    private CoinMapper coinMapper;
    @Override
    public Coin query(Coin coin) {
        return coinMapper.query(coin);
    }


    @Override
    public boolean addCoin(Coin coin) {
        int num = coinMapper.addCoin(coin);
        if(num>0){
            return true;
        }else{
            return false;
        }
    }
}
